Real-time correction of channel-bed roughness and water level in river network hydrodynamic modeling for accurate forecasting

The accuracy and reliability of hydrodynamic models are sensitive to both hydraulic state variables and model parameters, particularly the bed roughness, while their simultaneous real-time corrections and corresponding effects still need to be well-established and understood. This paper presents a real-time data assimilation model that corrects channel-bed roughness and water level in a river network hydrodynamic model, ensuring its accuracy and reliability. Experiments and parameter analysis evaluated the effect of initial roughness and observation noise level on model performance. Correcting both roughness and water level improved filtering time and forecasting accuracy by up to 63% and 80%, respectively, compared to methods only correcting water level. The filtering time was reduced by 44–63%, and the water level forecasting RMSE decreased by up to 80%. Both models experienced increased filtering time and forecasting error as observation noise increased, but the proposed model had a lower increase. With accurate hydraulic state measurement (e.g., 0.005 m error), the model achieved negligible water level forecasting error after 7 h of data assimilation. The model's accuracy depended on the initial channel-bed roughness, and the algorithm enables real-time roughness correction, making it useful for flood forecasting.


River network hydrodynamic system and data assimilation
Saint Venant equations are often used to describe the one-dimensional flow, as follows: Continuous equation:

Momentum equation:
where A is cross-section area; t is time; Q is average flow of cross-section; x is displacement along the water flow; q L is lateral streamflow per unit length; a is momentum correction coefficient; g is the acceleration of gravity; Z is the water level of section; K is the flow modulus, K = AR 2/3 /n, where R is the hydraulic radius of the river and n is the Manning coefficient; v x is the velocity component of the lateral stream flow along the water flow, usually taken as v x = 0. Saint Venant equations are hyperbolic partial differential equation for which analytical solutions are not yet available.The finite difference method is an effective numerical discretization method for solving the Saint Venant equations and is divided into two schemes: the explicit difference scheme and the implicit difference scheme.Although the explicit difference scheme does not require a joint solution of equations, the time step and space step are limited by strict adherence to the "Courant condition" in order to maintain stability, whereas the implicit difference scheme is more flexible in the selection of the time and space step and is therefore popularly used.In this paper, the Preissmanm four-point implicit difference scheme is adopted to discretize the equations, and the space-time discretization scheme of the continuous and momentum equations are obtained as follows: Difference form for the continuous equations: (1) ∂A ∂t Difference form for the momentum equations: where θ is the Preissmanm weighting factor; superscripts t and t + 1 and subscripts i and i + 1 represent the time and one-dimensional spatial layers respectively; B is the river width.Thus, the linear equations expressed in increments is obtained: where A 1i ~ E 2i are the expressions for each of the known quantities in time layer t.After elimination of the elements, we can obtain: where The corresponding section recurrence equations are obtained by sequentially working backwards from the first section of the river to any section: where when i = 0 (3) For a river with m reaches, the number of cross sections is m + 1.Based on Eq. ( 7), we can get: where According to the above equations, we can see that the flow increment at the first and last cross-sections of the river can be expressed in terms of the increment of water level.Therefore, the corresponding equations using non-increment can be obtained by expanding Eq. (12).
The equations are: To solve the hydrodynamic process of a river system, the Saint-Venant equations can be utilized.The existing Saint-Venant equations include a series of nonlinear partial derivative equations 25 .Considering the influence of channel-bed roughness on the hydrodynamic process, the general form of these unsteady hydrodynamic equations can be written as: where X = the hydraulic state variable, such as discharge, water level or water depth;n = the river channel-bed roughness, which is taken as a spatiotemporal variable.Note that the conventional form of one-dimensional unsteady hydrodynamic equations is simplified as: given the roughness layer is uniform and varies insignificantly; t = the time.
For the ease of numerical evaluation and implementation, a space-time discretization procedure is carried out for the real-fluid flow in above natural system because the Saint-Venant equations are nonlinear hyperbolic partial differential equations and cannot be solved analytically using the initial conditions 25 .Since the hydraulic state variables are influenced by white noise, the discretized nonlinear hydraulic state equation can be expressed as: k is a nonlinear hydraulic state functional from the state at k − 1 to the state at k , including a series of discrete equations of the hydrodynamic model.The details of the development of these discrete equations by using the finite difference method can be found in 26 k is the weighting matrix for the white noise of hydraulic state variables, which is taken as a unit matrix; W (1)   k is a white noise with a mean value that is equal to zero.In this paper, we aim to improve the simulation accuracy of water level through the prior knowledge of the channel-bed roughness, the roughness is then also discretized as: k is a roughness function from the state at k − 1 to the state at k ; Ŵ (2)   k is the weight matrix for the white noise of roughness.W (2)   k is a roughness's white noise with a mean value equal to zero.The state measurements Y k (e.g., discharge, water level and water depth) of a river network are then written as: where H k is the linear measurement function at time k ; V k is the measurement noise with a mean value equal to zero.In this paper, state measurement variable, i.e., water level, is selected as a variable for forecasting.www.nature.com/scientificreports/Finally, the hydrodynamic nonlinear dynamic system of a river network considering river roughness as a variable can be obtained by combining Eqs. ( 2)-( 4).The corresponding equations are then written as: Note that the nonlinear hydraulic state function φ (1)   k is determined by the numerical discrete form of a river hydrodynamic equation; the measurement function H k is determined by the measured state variables.In general, the change of roughness between two consecutive time steps is minimal; it thus can be negligible.Consequently, the roughness function φ where I is a unit matrix.
This paper develops a new data assimilation algorithm with both real-time roughness correction and water level correction based on the extended Kalman filtering algorithm.The river network hydrodynamic system is a nonlinear dynamic system, so it should be linearized to meet the processing requirements of the Kalman filtering algorithm.Given the state estimate X k−1 and n k−1 at time k − 1 , we rewrite the nonlinear hydraulic state equation and river roughness equation by conducting Taylor expansion in terms of X k−1 and n k−1 .The linear items are then adopted, which are expressed as: where is tangent state operator, and is noise weight matrix, which is usually taken as unit matrix I.
In this paper, the new data assimilation scheme using the extended Kalman filtering technology is used for water level forecasting of river networks considering the simultaneous real-time correction of roughness and water level.
The corresponding real-time correction algorithms are as follows: 1.The first step is to obtain the simulation values of water level and roughness for forecasting: 2. Then the prediction error variance matrix is obtained: where is white noise covariance matrix; Q k is the covariance matrix for the white noise of water level; Q k is covariance matrix for the white noise of roughness.3. Gain matrix is also obtained as: where R k is measurement noise covariance matrix.4. The water level and roughness are then updated as: 5. Finally, the correction error variance matrix is calculated: If the state vector X contains m water level or flow variables, the roughness vector n contains n roughness parameters, and the measurement vector Y contains s observed variables, then the corresponding quantities in the algorithm are elaborated as follows: 1.The filter error covariance matrix at time k − 1 can be denoted as 2. The tangential state operator can be denoted as: 3. The dynamic noise covariance can be denoted as 4. The observation noise covariance can be denoted as: 5. predicted error variance matrix using Eqs.(17) to (20), can be obtained as: 6. Gain matrix is obtained as: 7. The filtering error variance matrix at time k can be denoted as: The above data filtering process is cycled continuously to update the simulated water level, discharge and river-bed roughness values for reach simulation moment with the elapsed time.If the correction error variance matrix is less than a certain critical value, the data assimilation process can be ended to improve the efficiency of the river network hydrodynamic model calculation.In practice, the data assimilation process should be restarted if the simulated water level values deviate from the measured values by a certain degree after the end of data assimilation.
The above data filtering process with simultaneous consideration of water level and roughness correction with the recurrence of time is then compared to that without real-time roughness correction.

Case description
A real river network named Le Liu Hong plain river network, with an area of 325 km 2 in China, was used to evaluate the effectiveness of the proposed data assimilation model.It is located in the southeast of Zhejiang Province, China.The river mouth is located on the coast of mainland China in the East China Sea.This river network has three sub-systems: Hongqiao, Lecheng and Liushi, according to topography and geomorphology, as demonstrated in Fig. 1.Each sub-system has a water level measuring station, i.e., Hongqiao station, Lecheng station and Liushi station.The statistics show that the hydrodynamic model of this Le Liu Hong plain river network includes 398 rivers, 304 nodes and a total of 1962 cross-sections.
Key foundational data was collected from a river network to construct the data assimilation system in this study.The measurement approach included establishing a cross-section every 200 m on average along the river network, with a more concentrated measurement approach for sections that suddenly narrowed or widened.Specific structures, such as sluices and dams, were individually measured to determine their geometric dimensions.Three strategically placed water level stations provided spatially distributed data, located in the central

Parameter setting and evaluation metrics
The initial channel-bed roughness for each section is set as 0.02.As the roughness is taken as a spatiotemporal variable, the real-time roughness values vary with the model running at different river sections.As the observation noise level δ could impact the data assimilation results, a series of δ values, i.e., 0, 0.0001, 0.0005, 0.001, 0.005, 0.01, and 0.05 m are used for understanding the influence of observation noise level on water level forecasting.Note that, in practice, the plain river network water level measurement error is normally between 0.001 and 0.01 m; during typhoons, it will be slightly larger.The corresponding relative observation noise values are less than 2% of water depth values.
To compare the forecasting performance of model configurations with roughness correction and without, the time for the algorithm to reach simulation stability, i.e., filtering time, is used as another evaluation metric.In addition, the root mean square error (RMSE) of the forecasting values compared to the measurement values at the start of data assimilation until the end of the water level simulation is taken as another evaluation metric.The calculation of RMSE can be written as: where M i are the measurements, S i are predicted values, and N is the number of the measurements available for analysis.
The simulation period is from 8:00 on August 7, 2019, to 8:00 on August 12, 2019 (5 days in total), assuming data assimilation from 0:00 on August 9, 2019.The filtering is ended if the elements on the diagonal of the water level correction error variance matrix are less than 0.001 2 m.The data assimilation algorithm based on the EKF with only water level correction is used as a reference algorithm.

Results and discussion
Figure 2 presents the water level simulation errors compared to the measured values when the observation noise level value is equal to 0.005 m.Similar results are obtained for other observation noise level values (i.e., 0, 0.0001, 0.0005, 0.001, 0.01, and 0.05 m).The data assimilation treatment is rather effective in reducing simulation errors, as the errors approach zero after the end of data assimilation at both measurement stations.However, the water level simulation errors increase with simulation time if no data assimilation treatment is performed (blue line in Fig. 2).Compared to the data assimilation with only water level correction (i.e., no channel-bed roughness correction), the one with both water level and channel-bed roughness correction produces a remarkable improvement in water level forecasting capacity. Figure 2 demonstrates that the filtering time until the stabilization of simulation error is much shorter regardless of the observation noise level for the model with roughness correction.The filtering time reduces significantly by 44-63%, as shown in Table 1.This relative change percentage is calculated by initially deducting the filtering time in the case with both water level and channel-bed roughness correction from the filtering time in the case with only water level correction, then dividing the result by the filtering time in the case with both water level and channel-bed roughness correction, and then finally multiplying by 100% to express in terms of percentage, as illustrated in Eq. ( 18).In addition, a large variation amplitude of water level forecasting errors is also observed during the data assimilation for the model without roughness correction.
where t both is the filtering time in the case with both water level and channel-bed roughness correction, t water_correction is the filtering time in the case with only water level correction.
In addition, the filtering time approximately linearly increases with the increasing observation noise level value for both data assimilation schemes (Fig. 3), while the increasing rate is much lower for the data assimilation model with both water level and channel-bed roughness correction compared to that without roughness correction.A similar observation is found for the water level forecasting error evaluation as RMSE values for the data assimilation model with only water level correction remarkably increase with the observation noise level, while RMSE values for the other model increase initially and stabilize at small values afterward at all the stations (Table 2; Fig. 4).For example, the water level RMSE values are from minimal up to 0.13 and 0.026 at Hongqiao station for the model with roughness correction and without, respectively.The RMSE decreases up to 80% at Hongqiao station when the observation noise level is 0.05.Thus, the forecasting accuracy of the data assimilation model with roughness correction is insensitive to the observation noise within a normal range (i.e., less than 0.01 m).

Description of river network
The above experimental evaluation on a real river network shows the high sensitivity of filtering time and low sensitivity of our model's forecasting accuracy to the observation noise level.Whether this result is impacted by   www.nature.com/scientificreports/ the other critical parameter (i.e., initial channel-bed roughness) and how this initial roughness influences data filtering and the forecasting performance are analyzed in this section.To simplify the calculation and reduce computational cost, a case study on a simulated river network with unsteady-state flows is carried out in this section.Note that this river network is referred from the literature 27 and illustrated in Fig. 5.

Parameter setting and boundary conditions
The observation noise level variable has values of 0.0, 0.0001, 0.0005, 0.001, 0.005, 0.01 and 0.05 m.The initial value of channel-bed roughness at each river section is the same and is set as 0.020, 0.023, or 0.026.The true roughness of river section 1-8, 10-12, and 14 is 0.023.The remaining river sections 9 and 13 have a true (c)  roughness of 0.026 and 0.020, respectively.Table 3 shows the parameter combination scheme of initial roughness and observation noise level.
To simplify the calculation, the boundary conditions at each entrance are assumed to be the same.The water flow rate from Node 1 to Node 7 was inputted into the model as the boundary condition of the upstream entrance (Fig. 6a).The water level at the exit (i.e., Node 14) was set as the downstream boundary condition (Fig. 6b).Water level measuring points are arranged at Nodes 9 and 13, which are recorded as Station 1 and Station 2.
The RMSE of water level forecasting (hereinafter referred to as "water level RMSE") and the RMSE of channelbed roughness (hereinafter referred to as "roughness RMSE") are selected as a model performance evaluation index.The impact of observation noise level on the filtering time with different scenarios of initial channel-bed roughness is also analyzed.

Results and discussion
Figure 7 shows that water level RMSE significantly increases with observation noise level regardless of initial channel-bed roughness at two measurement stations.This observation indicates that the impact of observation noise level on the data assimilation and forecasting accuracy, found in "Experimental evaluation", is not interfered with by the setting of the initial channel-bed roughness.Also, the simulated river network demonstrates that filtering time is highly sensitive to observation noise level regardless of initial channel-bed roughness, as shown in Fig. 8. Consequently, the careful measurement of water level in practice should be taken to achieve efficient data assimilation and water level forecasting.For a normal range of observation noise level in practice (i.e., less than 0.01 m), our data assimilation model with both channel-bed roughness correction and water level correction could maintain a low water level RMSE and a short filtering time; thus, it has a good capacity of water level forecasting.Interestingly, the water level RMSE values in the simulated river network are much lower than that in the practice river network (i.e., Le Liu Hong plain river network).As shown in Table 2, the water level RMSE at different measurement stations for the Le Liu Hong plain river network ranges from 0.005 to 0.026 m, while the water level RMSE for the simulated river network is generally less than 0.005 m, as presented in Fig. 7.This is reasonable as the practice river network is more complex than the simulated one.
Figure 7 also shows that the data assimilation treatment with the initial roughness value of 0.023 produces the minimum water level RMSE values compared to the other two initial roughness values (i.e., 0.020 and 0.026).This result is also consistent with the variation of the roughness RMSE with different initial roughness values at different observation noise levels, as shown in Fig. 9. Given that most river sections have true roughness of 0.023, and only one river section has true roughness of 0.020 (i.e., section 13) and 0.026 (i.e., section 9), indicating that the closer the initial channel-bed roughness value is to the true roughness value, the more accurate the forecasting result is.A trial-and-error testing can be conducted in the river network to estimate the optimum channel-bed roughness value as an input to the data assimilation model.Figure 9 also shows that the roughness RMSE is generally insensitive to the change of observation noise level.This is expected as the channel-bed roughness is determined by the river bed nature rather than the water level measurements.
We further analyze the corrected channel-bed roughness value at each river section calculated from the data assimilation model with the inputs of different initial roughness values (i.e., 0.020, 0.023, and 0.026).Three observation noise levels of 0.0001, 0.001 and 0.01 m are analyzed.Figure 10 shows that the corrected roughness of each river section deviates far away from the true roughness when the initial roughness value is 0.020 or 0.026, while the corrected roughness values of different river sections approach the true values when the initial roughness value is 0.023, which is equal to most river sections' true roughness of 0.023.
The comparison study shows that the selection of initial river roughness as inputs to the data assimilation model is important for realizing a bed roughness close to the true one and thus for improving the forecasting accuracy of hydraulic state variables such as water level.This result is expected as the roughness conditions on the channel bed could significantly influence the open-channel flow and the associated transport processes in rivers, streams, and estuaries.Several methods are commonly applied to estimate river bed roughness in practice, including direct measurement of roughness elements such as grain size and sediment shape, remote sensing using satellite imagery or aerial photography 28,29 , numerical modeling using MIKE11 or Delft3D models to simulate the flow and sediment transport processes in a river 30 , and empirical models based on empirical relationships such as Manning equation using measurable parameters (e.g., river width, slope and discharge) 20,31 .There is no universe method for different real river networks.As such, a comparison study should be conducted to determine a cost-effective and accurate roughness estimation method.
Due to the contribution of bed roughness correction during the data assimilation process, the filtering time has become shorter to 7 h, which is more practical in the field than the filter time produced by the model without bed roughness correction.This short filtering time is comparable to other studies.For example, Karri et al. 32 showed that their data assimilation treatment coupling with the ensemble Kalman filter and hydrodynamic model had the highest forecast quality for the forecast horizon of up to 6 h, beyond which the forecasting error started to fluctuate.
Although the experimental evaluation demonstrates that a high water-level forecasting capacity of the data assimilation model can be achieved if both water level and channel-bed roughness can be corrected in a realtime manner, the data assimilation model with only water level correction does not produce a relatively large forecasting error within the normal range of observation noise level, as shown in Fig. 4.This is because our experimental evaluation is performed in a plain river network instead of a mountain river network with turbulent flows and steep slopes (from 0.4 to 5%), which could be significantly influenced by bed roughness 33 .Future studies could be conducted on a mountain river network to test the contribution of the bed roughness correction during the data assimilation process.The uniqueness of our research lies in the real-time correction of both channel-bed roughness and water level using the extended Kalman filter, enhancing the accuracy and reliability of the river network hydrodynamic model.In contrast to existing methods that typically correct these parameters independently, our approach considers the intricate relationship between the two, optimizing them concurrently.This joint correction led to substantial improvements in filtering time (44-63% reduction) and water level forecasting accuracy (up to 80% increase) compared to methods that only address water level.Furthermore, our model demonstrates greater resilience to observation noise, presenting a lower increase in filtering time and forecasting error as noise increased.It even achieved negligible water level forecasting error after seven hours of data assimilation with accurate hydraulic state measurements.Our study is innovative in that it introduces an algorithm enabling   real-time correction of roughness, thereby improving model performance significantly, particularly useful in the realm of flood forecasting.Roughness and water level are crucial variables in the hydrodynamic modeling process.Their accurate estimation and correction significantly impact the accuracy and reliability of the model.Notably, roughness, as a model parameter, and water level, as a hydraulic state variable, often exhibit strong mutual influence, thus justifying their joint optimization.It is important to note, however, that while water temperature, climatic conditions, and other variables undoubtedly impact the hydrodynamics of a river network, incorporating all these factors simultaneously would result in an exceedingly complex model.The integration of these parameters could lead to the model becoming computationally intensive and potentially intractable.Therefore, we have chosen to focus our research on two of the most influential parameters-roughness and water level-to balance the trade-off between model complexity and computational efficiency.We believe that optimizing these two variables constitutes a meaningful and significant step towards improving hydrodynamic model accuracy and reliability.In future work, we aim to incrementally integrate more variables into the model, provided they can enhance the predictive capabilities without overly complicating the model.
It is also crucial to highlight a key limitation encountered in our methodology.While our method exhibits the capability to effectively track true roughness in various scenarios, its performance is significantly influenced by the accuracy of the initial roughness value set.Specifically, as demonstrated in Fig. 10, if the initial roughness is set to values such as 0.020 or 0.026, the updating process may not converge to the true roughness value of 0.023.Consequently, the accuracy in predicting roughness is dependent on ensuring that the initial roughness value is set with precision.Potential users of this methodology should be cognizant of this aspect and consider the necessity for trial-and-error tests to ascertain the most accurate initial roughness for their specific scenarios.
In this study, the traditional extended Kalman filter coupling with the river network hydraulic model is used to carry out the data assimilation with the real-time correction of both hydraulic state variables and model parameters.Given that Kalman filter coupling with hydraulic models is one of the efficient methods to adjust real-time flood series for reducing forecasting errors 4,5,34 , future studies can be carried out to compare other improved types of Kalman filters, such as ensemble Kalman filter 32,35 and traceless Kalman filter 36 in terms of model forecasting capacity.

Conclusion
In this paper, we develop a new data assimilation model that uses the extended Kalman filtering method to simultaneously correct both the channel-bed roughness and water level.These are the key model parameters and state variables of a river network hydrodynamic model.The influence of the initial roughness and observation/ measurement noise level on the model performance in terms of water level forecasting accuracy and filtering time is investigated thorough experimental evaluation and parameter analysis.The results are also compared to the data assimilation model with only real-time correction of state variable, i.e., water level in this study.The following conclusions can be obtained: 1. Regardless of the observation noise level, both filtering time and water level forecasting error are significantly reduced in the data assimilation model that corrects both the water level and channel-bed roughness, compared to the model that only corrects the water level.In the case of a real river network, filtering time is reduced significantly by 44-63%.The RMSE values for water level forecasting are substantially decreased by up to 80%. 2. Both filtering time and water level forecasting error increase with the observation noise level for both models, regardless of the initial roughness.However, the increase is much lower for the data assimilation model that corrects both the water level and channel-bed roughness, compared to the model that only corrects the water level.With relatively accurate measurements of hydraulic state variables in practice (e.g., with a measurement error level of 0.005 m), the model can forecast the state variables well with a negligible error after around 7 h of data assimilation.3. It is important to note a limitation of our method: the accuracy of tracking true roughness is highly dependent on the initial roughness value set.As shown in Fig. 10, when the initial values were set to either 0.020 or 0.026, the method struggled to converge to the true roughness of 0.023.Users of this approach should be aware of this dependency and the potential need for trial-and-error in setting the initial roughness accurately.The water level forecasting error can be further reduced if the initial channel-bed roughness at each river section is closer to the true value.The impact of the initial roughness values on the model's forecasting performance is independent of the measurement errors.An optimal channel-bed roughness value is thus crucial for improving water level forecasting in practice. https://doi.org/10.1038/s41598-023-42791-x

Figure 3 .
Figure 3. Influence of observation noise level on the filtering time for the Le Liu Hong plain river network.

Figure 4 .
Figure 4. Water level forecasting error evaluation by RMSE with different observation noise levels for both models at (a) Hongqiao station, (b) Lecheng station, (c) Liushi station.

Figure 5 .
Figure 5.The schematic diagram of the simulated water river network.

Figure 6 .
Figure 6.Boundary condition for the (a) upstream entrance and (b) exit.

Figure 7 .Figure 8 .
Figure 7. Impact of observation noise level and initial roughness on water level RMSE at (a) Station 1 and (b) Station 2.

Figure 9 .
Figure 9. Impact of observation noise level and initial roughness on roughness RMSE.

Figure 10 .
Figure 10.Corrected roughness values at each river section at the setting of initial roughness value of (a) 0.020, (b) 0.023, and (c) 0.026.
parts of three sub-areas of the plain river network, each approximately 12 km apart.These stations collected water level data every 5 min, ensuring a frequent and consistent stream of observational data.The study utilized data gathered during the 2019 Lekima Typhoon flood event, collected from 8 AM on August 7, 2019, to 8 AM on August 12, 2019, thus offering a continuous, high-frequency dataset over a 5-day period.This data set is directly stored in our computer systems, enabling immediate access for comparison with our model's calculated results.The stored data is processed by our data assimilation system running the proposed algorithm to execute the simultaneous correction of roughness and water level.The Windows 10 computer used for the analysis was equipped with an Intel Core i7-8700 K processor with a clock speed of 3.2 GHz and DDR4 RAM of 16.0 GB.

Table 1 .
Filtering time at different observation noise levels for two data assimilation schemes.*Means nonconvergence.

Table 2 .
Impact of observation noise level on the data assimilation performance regarding forecasting RMSE.

Table 3 .
The test combination scheme.√ means the simulation is successful.